<#assign menu="brand">
<#assign submenu="update_brand">
<#include "../../manage/head.ftl">
<!--main content start-->
<style type="text/css">

</style>
<section id="main-content">
    <section class="wrapper">
        <!-- page start-->
        <form id="update_brand_form" class="form-horizontal" action="${BASE_PATH}/manage/brand/update.json"
              autocomplete="off" method="post"
              enctype="multipart/form-data">
            <fieldset>
                <div class="row">
                    <input type="hidden" name="brandId" value="${brand.id}">

                    <div class="col-lg-12">
                        <section class="panel">
                            <header class="panel-heading">
                                编辑品牌
                            </header>
                            <div class="panel-body">
                                <div class="form-group">
                                    <label class="col-sm-2 col-sm-2 control-label">logo</label>

                                    <div class="col-sm-10">
                                        <img src="${brand.logo}" alt="img04" style="height:120px;">
                                        <input type="file" name="file"
                                               id="file">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 col-sm-2 control-label">banner</label>

                                    <div class="col-sm-10">
                                        <img src="${brand.banner}" alt="img04" style="height:120px;">
                                        <input type="file" name="file1"
                                               id="file1">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 col-sm-2 control-label">goodsBanner</label>

                                    <div class="col-sm-10">
                                        <img src="${brand.goodBanner}" alt="img04" style="height:120px;">
                                        <input type="file" name="file2"
                                               id="file2">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 col-sm-2 control-label">品牌名</label>

                                    <div class="col-sm-10">
                                        <input type="text" style="font-size:15px;width: 300px;" class="form-control"
                                               name="name"
                                               placeholder="名字" id="name" value="${brand.name}">
                                        </input>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <div class="col-lg-offset-2 col-lg-10">
                                        <button class="btn btn-shadow btn-primary" type="submit">更新</button>
                                    </div>
                                </div>
                            </div>

                        </section>

                    </div>
                </div>
            </fieldset>
        </form>
        <!-- page end-->
    </section>
</section>

<script type="text/javascript">

    $(function () {
            $('#update_brand_form').ajaxForm({
                dataType: 'json',
                success: function (data) {
                    if (data.result) {
                        bootbox.alert("保存成功，将刷新页面", function () {
                            window.location.reload();
                        });
                    } else {
                        showErrors($('#update_brand_form'), data.errors);
                    }
                }
            });

            $('.js_create_time').datetimepicker({
                language: 'zh-CN',
                format: "yyyy-mm-dd",
                weekStart: 1,
                todayBtn: 1,
                autoclose: 1,
                todayHighlight: 1,
                startView: 2,
                minView: 2,
                forceParse: 0
            });
        });
</script>
<#include "../../manage/foot.ftl">
